home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / biz / demo / imagefxdemo.dms / imagefxdemo.adf / rexx / Border.ifx next >
Text File  |  1992-09-24  |  1KB  |  97 lines

  1. /*
  2.  * $VER: Border 1.00.00 (24.9.92)
  3.  *
  4.  * Arexx program for the ImageFX image processing system.
  5.  * Written by Thomas Krehbiel
  6.  *
  7.  * This program will generate a 3D-looking border around the
  8.  * current image.
  9.  *
  10.  */
  11.  
  12. OPTIONS RESULTS
  13.  
  14. GetMain ; IF result = "" THEN EXIT ; PARSE VAR result name width height depth
  15.  
  16. RequestNumber '"Border Thickness (Pixels):"' 1 30 10
  17. IF rc ~= 0 THEN EXIT 0     /* cancelled? */
  18. count = result
  19.  
  20. LockInput
  21.  
  22. SaveUndo ; Undo Off
  23.  
  24. BeginBar 'Border' count
  25. LockGUI
  26.  
  27. Redraw Off
  28.  
  29. step = 255 / (count-3)
  30. grey = step
  31. le = 0
  32. te = 0
  33. wid = width
  34. ht = height
  35.  
  36. DO i = 0 TO count - 3
  37.  
  38.    UnlockGUI
  39.    Bar i
  40.    LockGUI
  41.  
  42.    /* the bright side */
  43.    SetPalette '-1' grey grey grey
  44.    Line le te le+wid-1 te
  45.    Line le te le te+ht-1
  46.  
  47.    /* the dark side */
  48.    SetPalette '-1' grey*2/3 grey*2/3 grey*2/3
  49.    Line le+wid-1 te le+wid-1 te+ht-1
  50.    Line le+wid-1 te+ht-1 le te+ht-1
  51.  
  52.    grey = grey + step
  53.    le = le + 1
  54.    te = te + 1
  55.    wid = wid - 2
  56.    ht = ht - 2
  57.  
  58.    END
  59.  
  60. grey = 255 - step
  61.  
  62. DO WHILE i < count
  63.  
  64.    UnlockGUI
  65.    Bar i
  66.    LockGUI
  67.  
  68.    /* the bright side */
  69.    SetPalette '-1' grey grey grey
  70.    Line le te le+wid-1 te
  71.    Line le te le te+ht-1
  72.  
  73.    /* the dark side */
  74.    SetPalette '-1' grey*2/3 grey*2/3 grey*2/3
  75.    Line le+wid-1 te le+wid-1 te+ht-1
  76.    Line le+wid-1 te+ht-1 le te+ht-1
  77.  
  78.    grey = grey - step
  79.    le = le + 1
  80.    te = te + 1
  81.    wid = wid - 2
  82.    ht = ht - 2
  83.  
  84.    i = i + 1
  85.  
  86.    END
  87.  
  88. UnlockGUI
  89. EndBar
  90.  
  91. Redraw On ; Undo On
  92. Redraw
  93.  
  94. UnlockInput
  95.  
  96. EXIT
  97.